#ifndef __WRITE_LOG_2017_04_25_H_
#define __WRITE_LOG_2017_04_25_H_


#define MAX_LOG_LEN			1024
#define LOG_FILE_PATH		"./temp.log"

#define MYLOG(level, __fmt, ...) \
	do {\
		if(level == DebugLog)\
			write_log("[Debug] " __fmt ", %s:%d", ##__VA_ARGS__, __FILE__, __LINE__);\
		else if (level == InfoLog)\
			write_log("[Info] " __fmt, ##__VA_ARGS__);\
		else if (level == AlarmLog)\
			write_log("[Alarm] " __fmt, ##__VA_ARGS__);\
		else if (level == ErrLog)\
			write_log("[Err] " __fmt, ##__VA_ARGS__);\
	} while (0)


typedef enum _LogLevel
{
	DebugLog = 0,
	InfoLog  = 1,
	AlarmLog = 2,
	ErrLog   = 3
} LogLevel;


void write_log(const char *__fmt, ...);


#endif


